﻿
using System;
using System.Drawing;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace Beauty.Module.Pos
{
	public partial class CreateNewJobshetVCtrl : UIViewController
	{
		public CreateNewJobshetVCtrl () : base ("CreateNewJobshetVCtrl", null)
		{
		}

		public override void DidReceiveMemoryWarning ()
		{
			// Releases the view if it doesn't have a superview.
			base.DidReceiveMemoryWarning ();
			
			// Release any cached data, images, etc that aren't in use.
		}

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			ivRequest.Image = PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check");
			 
			ivWalkIn.Image = PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck");
			 
			btnCreateJobsheet.Layer.CornerRadius = 25.0f;
			btnCreateJobsheet.Layer.ShadowOpacity = 0.0f; 
			btnCreateJobsheet.Layer.BorderWidth = 1.0f;
			btnCreateJobsheet.Layer.BorderColor = UIColorExtensions.FromHexString ("#ff485f").CGColor;
			btnCreateJobsheet.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ebeef0").CGColor;

			btnSelectCustomer.Layer.CornerRadius = 15.0f;
			btnSelectCustomer.Layer.ShadowOpacity = 0.0f; 
			btnSelectCustomer.Layer.BorderWidth = 1.5f;
			btnSelectCustomer.Layer.BorderColor = UIColorExtensions.FromHexString ("#979797").CGColor;
			btnSelectCustomer.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ffffff").CGColor;

			btnSelectStaff.Layer.CornerRadius = 15.0f;
			btnSelectStaff.Layer.ShadowOpacity = 0.0f; 
			btnSelectStaff.Layer.BorderWidth = 1.5f;
			btnSelectStaff.Layer.BorderColor = UIColorExtensions.FromHexString ("#979797").CGColor;
			btnSelectStaff.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ffffff").CGColor;

			btnSelectService.Layer.CornerRadius = 15.0f;
			btnSelectService.Layer.ShadowOpacity = 0.0f; 
			btnSelectService.Layer.BorderWidth = 1.5f;
			btnSelectService.Layer.BorderColor = UIColorExtensions.FromHexString ("#979797").CGColor;
			btnSelectService.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ffffff").CGColor;

			ViewMain.Layer.BorderWidth = 1.0f;
			ViewMain.Layer.BorderColor = UIColorExtensions.FromHexString ("#b2b2b2").CGColor;
			ViewMain.Layer.CornerRadius = 5.0f;

			btnClose.SetBackgroundImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close"), UIControlState.Normal);
//			btnClose.TouchUpInside += (object sender, EventArgs e) => {
//				Console.WriteLine("xxx");
//				closePopup();
//
//			};

		 
			// Perform any additional setup after loading the view, typically from a nib.
		}
		void closePopup()
		{
			UIView.AnimateAsync (0.25, animation: () => {
				View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
				View.Alpha = 0f;
			});
		}
		 
		public void showAnimation(){
			View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
			View.Alpha = 0;
			UIView.AnimateAsync (0.25f, animation: () => {
				View.Alpha = 1;
				View.Transform = CGAffineTransform.MakeScale(1,1);
			});
		}
	}
}

